local skel = fk.CreateSkill {
  name = "lb_zero__zhuixuan",
}

Fk:loadTranslationTable {
  ["lb_zero__zhuixuan"] = "锥旋",
  [":lb_zero__zhuixuan"] = "你可将一张黑色牌当雷【杀】使用，若未造成伤害，你摸一张牌并令你本轮下张属性【杀】伤害+1。",

  ["#lb_zero__zhuixuan"] = "锥旋：你可以将一张黑色牌当雷【杀】使用，若未造成伤害，你摸一张牌并令你本轮下张属性【杀】伤害+1",

  ["@lb_zero__zhuixuan-round"] = "锥旋",

  ["$lb_zero__zhuixuan1"] = "该干活了伙计！",
  ["$lb_zero__zhuixuan2"] = "直达地心！",
  ["$lb_zero__zhuixuan3"] = "转啊转啊转转转！",
}


skel:addEffect("viewas", {
  anim_type = "offensive",
  pattern = "slash",
  prompt = "#lb_zero__zhuixuan",
  handly_pile = true,
  filter_pattern = {
    min_num = 1,
    max_num = 1,
    pattern = ".|.|black",
  },
  view_as = function(self, player, cards)
    if #cards ~= 1 then return end
    local c = Fk:cloneCard("thunder__slash")
    c.skillName = skel.name
    c:addSubcard(cards[1])
    return c
  end,
  after_use = function(self, player, use)
    if player:isAlive() and not use.damageDealt then
      player:drawCards(1, skel.name)
      player.room:addPlayerMark(player, "@lb_zero__zhuixuan-round")
    end
  end,
  enabled_at_response = function(self, player, response)
    return not response
  end,
})

skel:addEffect(fk.PreCardUse, {
  is_delay_effect = true,
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name) and target == player
        and table.contains({ "fire__slash", "thunder__slash", "ice__slash" }, data.card.name)
        and player:getMark("@lb_zero__zhuixuan-round") > 0
  end,
  on_use = function(self, event, target, player, data)
    local num = player:getMark("@lb_zero__zhuixuan-round")
    data.additionalDamage = (data.additionalDamage or 0) + num
    data.extra_data = data.extra_data or {}
    data.extra_data.lb_zero__zhuixuan = num
    player.room:setPlayerMark(player, "@lb_zero__zhuixuan-round", 0)
  end,
})


return skel
